package com.smarttourism.service.impl;

import com.smarttourism.domain.Hotel;
import com.smarttourism.mapper.GoodsMapper;
import com.smarttourism.mapper.HotelMapper;
import com.smarttourism.service.HotelService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Author：王祖威
 * @Date ：2024/10/23 17:34
 */
@Service
public class HotelServiceImpl implements HotelService {

    @Autowired
    private HotelMapper hotelMapper;


    @Override
    public int add(Hotel hotel) {
        return hotelMapper.insert(hotel);
    }

    @Override
    public int removeBatch(Integer[] ids) {
        return hotelMapper.delete(ids);
    }

    @Override
    public int updateById(Hotel hotel) {
        return hotelMapper.update(hotel);
    }

    @Override
    public Hotel findById(Integer id) {
        return hotelMapper.selectById(id);
    }

    @Override
    public List<Hotel> findAll(String hName, String city) {
        return hotelMapper.selectAll(hName,city);
    }
}
